<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
								<p>应用：</p> <select name="appId"
								th:with="type=${@dict.getType('sys_app_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
										th:value="${dict.dictValue}"></option>
							</select>
							</li>
                            <li>
                                <p>kkid：</p>
                                <input type="text" name="kkid"/>
                            </li>
                            <li>
                                <p>昵称：</p>
                                <input type="text" name="nickname"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">

            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('user:kkuser:edit')}]];
        var removeFlag = [[${@permission.hasPermi('user:kkuser:remove')}]];
        var appIdDatas = [[${@dict.getType('sys_app_type')}]];
        var genderDatas = [[${@dict.getType('account_user_sex')}]];
        var prefix = ctx + "user/kkuser";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "用户",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : 'id',
                    visible: false
                },
                {
                    field : 'appId', 
                    title : '应用id',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(appIdDatas, value);
                    }
                },
                {
                    field : 'kkid', 
                    title : 'kkid'
                },
                {
                    field : 'nickname', 
                    title : '昵称'
                },
                {
                    field : 'portrait', 
                    title : '头像',
                    formatter: function(value, row, index) {
                    	if(value){
                    		return $.table.imageView(value);
                        }
                    	return ''
                	}
                },
                {
                    field : 'gender', 
                    title : '性别',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(genderDatas, value);
                    }
                },
                {
                    field : 'createdTime',
                    title : '注册时间'
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>